package com.turing.common.util.uncompress.factory;

import com.turing.common.constants.FileType;
import com.turing.common.util.uncompress.AbstractUncompress;
import com.turing.common.util.uncompress.RarUncompress;
import com.turing.common.util.uncompress.SevenZipUncompress;
import com.turing.common.util.uncompress.ZipUncompress;

public class UncompressFactory {
    public static AbstractUncompress createUncompress(String type){
        AbstractUncompress uncompress=null;
        switch (type) {
            case FileType.ZIP:
                uncompress=new ZipUncompress();
               break;
            case FileType.RAR:
                uncompress=new RarUncompress();
                break;
            case FileType.SEVENZ:
                uncompress=new SevenZipUncompress();
                break;
        }
        return uncompress;
    }
}